﻿using SqlSugar;
using Zhp.SqlSugar.Entity;

namespace Zhp.SqlSugar.Trigger
{
    public interface ITriggerService<InEntity, TKey> where InEntity : BaseEntity<TKey>, new()
    {
        public void Inserted(ISqlSugarClient context, InEntity entity);
        public void InsertedRange(ISqlSugarClient context, List<InEntity> entity);
        public void Updated(ISqlSugarClient context, InEntity entity);
        public void UpdatedRange(ISqlSugarClient context, List<InEntity> entity);
        public void Deleted(ISqlSugarClient context, InEntity entity);
        public void DeletedRange(ISqlSugarClient context, List<InEntity> entity);

        public Task InsertedAsync(ISqlSugarClient context, InEntity entity);
        public Task InsertedRangeAsync(ISqlSugarClient context, List<InEntity> entity);
        public Task UpdatedAsync(ISqlSugarClient context, InEntity entity);
        public Task UpdatedRangeAsync(ISqlSugarClient context, List<InEntity> entity);
        public Task DeletedAsync(ISqlSugarClient context, InEntity entity);
        public Task DeletedRangeAsync(ISqlSugarClient context, List<InEntity> entity);
    }
}
